package com.wsd.smartcarwasher.util;

import java.io.File;
import java.io.IOException;

public class FileUtil {

    public static File createFile(String fileName) throws IOException {
        File file = new File(fileName);
        if (!file.getParentFile().exists() && !file.getParentFile().mkdirs()) {
            throw new IOException("创建文件目录失败");
        } else if (!file.exists() && !file.createNewFile()) {
            throw new IOException("新建文件失败");
        } else {
            return file;
        }
    }

}
